package com.xiaoshou.dao;

import org.hibernate.Query;
import org.springframework.stereotype.Repository;

import com.xiaoshou.pojo.Lectures;
@Repository
public class LecturesDao extends BaseDao<Lectures, String>{

	public void saveLecture(Lectures lecture) {
		String sql = "insert into lectures values(':id',':time',':purpose',':feedback',':contentrecord',':t_user_id',':clientid',':reserlecture',':state',':lectureraddress')";
		Query query = getSession().createSQLQuery(sql);
		query.setParameter("id",lecture.getId());
		query.setParameter("purpose", lecture.getPurpose());
		query.setParameter("feedback", lecture.getFeedback());
		query.setParameter("contentrecord", lecture.getContentrecord());
		query.setParameter("t_user_id", lecture.getUser().getId());
		query.setParameter("reserlecture", lecture.getReserlecture());
		query.setParameter("state", "预约");
		query.executeUpdate();
	}

}
